<script setup lang="ts">
	import { ref } from "vue";
	import { formRules } from "./utils/rule";
	import { FormProps } from "./utils/types";
	import ReCol from "@/components/ReCol";
	const props = withDefaults(defineProps<FormProps>(), {
		formInline: () => ({
			title: "",
			status: 0,
			scanLogId: 0
		})
	});
	const ruleFormRef = ref();
	const newFormInline = ref(props.formInline);
	function getRef() {
		return ruleFormRef.value;
	}
	defineExpose({ getRef });
</script>

<template>
	<el-form ref="ruleFormRef" :model="newFormInline" :rules="formRules" label-width="auto">
		<el-row :gutter="30">
			<re-col :value="12" :xs="24" :sm="24">
				<el-form-item label="邮件条码" prop="postBarcode">
					<el-input v-model="newFormInline.postBarcode" clearable placeholder="请输入邮件条码" />
				</el-form-item>
			</re-col>
			<re-col :value="12" :xs="24" :sm="24">
				<el-form-item label="供件台" prop="supplyPlcId">
					<el-input v-model="newFormInline.supplyPlcId" clearable placeholder="请输入供件台" />
				</el-form-item>
			</re-col>
			<re-col :value="12" :xs="24" :sm="24">
				<el-form-item label="小车号" prop="carNumber">
					<el-input v-model="newFormInline.carNumber" clearable placeholder="请输入小车号" />
				</el-form-item>
			</re-col>
			<re-col :value="12" :xs="24" :sm="24">
				<el-form-item label="识别状态" prop="identStatus">
					<el-input v-model="newFormInline.identStatus" clearable placeholder="请输入识别状态" />
				</el-form-item>
			</re-col>
			<re-col :value="12" :xs="24" :sm="24">
				<el-form-item label="识别类型" prop="identType">
					<el-input v-model="newFormInline.identType" clearable placeholder="请输入识别类型" />
				</el-form-item>
			</re-col>
			<re-col :value="12" :xs="24" :sm="24">
				<el-form-item label="扫描时间" prop="scanTime">
					<el-date-picker
						v-model="newFormInline.scanTime"
						type="datetime"
						placeholder="请选择扫描时间"
						format="YYYY-MM-DD HH:mm:ss"
						value-format="YYYY-MM-DD HH:mm:ss"
						style="width: 100%;"
					/>
				</el-form-item>
			</re-col>
		</el-row>
	</el-form>
</template>
<style scoped>
	.avatar-uploader .el-upload {
		border: 1px dashed var(--el-border-color);
		border-radius: 6px;
		cursor: pointer;
		position: relative;
		overflow: hidden;
		transition: var(--el-transition-duration-fast);
	}

	.avatar-uploader .el-upload:hover {
		border-color: var(--el-color-primary);
	}

	.el-icon.avatar-uploader-icon {
		font-size: 28px;
		color: #8c939d;
		width: 178px;
		height: 178px;
		text-align: center;
	}
</style>